<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_search
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
$latest = $this->latestnews;
$listnews = $this->listnews;
$latestNewsSlide = $this->latestNewsSlide;
$document = &JFactory::getDocument();
$document->addScript( 'html/textSlide/slides.min.jquery.js' );
$catid = JRequest::getVar('catid');
?>
<script>
	jQuery.noConflict();
	jQuery(function(){
		jQuery('#slides').slides({
			generateNextPrev: false,
			play: 5000
		});		
		jQuery('#slides .pagination').hide();					
	});
</script>
<form action="" method="post" name="adminForm" id="adminForm">
<div style="padding:5px;"></div>
<div id="slides">
    <div class="slides_container">
    	<?php for($i=0;$i<sizeof($latestNewsSlide);$i++){?>
        <div>
        	<h3><a href="index.php?option=com_news&view=news&page=detail&catid=<?php echo $catid?>&id=<?php echo $latestNewsSlide[$i]->id?>"><?php echo $latestNewsSlide[$i]->title?></a></h3>
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td valign="top" style="padding-right: 10px;">
                   <?php
                    $imagePath = Utilities::renderthumbnail($latestNewsSlide[$i]->images);
                    if ($imagePath){
                    ?>          
                    <a href="index.php?option=com_news&view=news&page=detail&catid=<?php echo $catid?>&id=<?php echo $latestNewsSlide[$i]->id?>"><img src="<?php echo $imagePath?>" /></a>
                    <?php }?>
                </td>
                <td valign="top">
                    <?php echo $latestNewsSlide[$i]->introtext?>
                    <span><a href="index.php?option=com_news&view=news&page=detail&catid=<?php echo $catid?>&id=<?php echo $latestNewsSlide[$i]->id?>">Read more...</a></span>
                </td>
            </tr>
            </table>            
        </div>
        <?php }?>
    </div>
</div>
<div style="padding:5px;"></div>
<?php /*?><?php if ($latest){?>
<div class="box-list latest-job">
	<div class="head-title">
		<h2><?php echo $latest->title?></h2>
	</div>
    <div class="width100">
    	<div class="float_left imageLeftFirst">
        	<div>
            	<?php
				$imagePath = Utilities::renderthumbnail($latest->images);
				if ($imagePath){
				?>          
             	<img width="120" src="<?php echo $imagePath?>" />
                <?php }?>
            </div>
        </div>
         <div class="float_left textLeftFirst">
        	<?php echo $latest->introtext?>
            <span><i><a href="index.php?option=com_news&view=news&page=detail&catid=<?php echo $catid?>&id=<?php echo $latest->id?>">Read more...</a></i></span>
        </div>
    	
    </div>
    <div class="clear"></div>
    <div style="height:5px">&nbsp;</div>
</div>
<?php }?><?php */?>
<table border="0" width="100%" cellpadding="5" cellspacing="0">
<?php for($i=0;$i<sizeof($listnews);$i++){?>   
     <tr>
     	<td valign="top">
        	<?php
			$imagePath = Utilities::renderthumbnail($listnews[$i]->images);
			if ($imagePath){
			?>          
			<a href="index.php?option=com_news&view=news&page=detail&catid=<?php echo $catid?>&id=<?php echo $listnews[$i]->id?>"><img src="<?php echo $imagePath?>" align="left" style="margin-right:8px;" /></a>
			<?php }?>
        	<h3><a href="index.php?option=com_news&view=news&page=detail&catid=<?php echo $catid?>&id=<?php echo $listnews[$i]->id?>"><?php echo $listnews[$i]->title?></a></h3>
            <div style="margin-top:-10px;margin-bottom:10px;"><img src="images/date-icon.png" width="16" />&nbsp;<?php echo date('d-m-Y',strtotime($listnews[$i]->created))?></div>
            <div>
				<?php echo $listnews[$i]->introtext?>
           	</div>
            <div class="clear"></div>
            <?php if ($i != sizeof($listnews) -1){?>
            <div class="border_line"></div>
             <?php }?>
        </td>
     </tr>
<?php }?>
</table>
<?php /*?><?php for($i=0;$i<sizeof($listnews);$i++){?>   
    <div class="width100">
        <div class="float_left imageLeft">
            <div style="width:80px">
            	<?php
				$imagePath = Utilities::renderthumbnail($listnews[$i]->images);
				if ($imagePath){
				?>          
             	<a href="index.php?option=com_news&view=news&page=detail&catid=<?php echo $catid?>&id=<?php echo $listnews[$i]->id?>"><img src="<?php echo $imagePath?>" /></a>
                <?php }?>
            </div>
        </div>
         <div class="float_left textLeft">
			<div><h3><a href="index.php?option=com_news&view=news&page=detail&catid=<?php echo $catid?>&id=<?php echo $listnews[$i]->id?>"><?php echo $listnews[$i]->title?></a></h3></div>
            <div style="margin-bottom:12px;margin-top:-8px;"><img src="images/date-icon.png" width="16" />&nbsp;<?php echo ($listnews[$i]->created || $listnews[$i]->created != '0000-00-00') ? date('d-m-Y',strtotime($listnews[$i]->created)) : ""?></div>
            <div><?php echo trim($listnews[$i]->introtext)?>
            <span><a href="index.php?option=com_news&view=news&page=detail&catid=<?php echo $catid?>&id=<?php echo $listnews[$i]->id?>">Read more...</a></span>
            </div>
        </div>
        
    </div>
    <div class="clear"></div>
    <?php if ($i != sizeof($listnews) -1){?>
	<div class="border_line"></div>
	<?php }?>    
<?php }?><?php */?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" border="1">
<tr height="10"></tr>
<tr>
    <td align="center">
        <?php
        echo $this->pagination->getPagesLinks();
        ?>
    </td>
</tr>	    	    
</table>
<div style="padding:5px;"></div>
	<input type="hidden" name="option" value="com_news" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
	<?php echo JHTML::_('form.token'); ?>
</form>
